import React from 'react';
import AddLoanOption from './AddLoanOption';

class AddLoanSelect extends React.Component{
	constructor(props){
		super(props);
	}
	handleChange(){`
		this.props.onUserSelect(this.refs.loanStatusSelect.value);
	}
	render(){
		var options = [];
		console.log('mainStatus',this.props.mainStatus);
		this.props.mainStatus.map(function(mainStatus){
			options.push(<AddLoanOption mainStatus={mainStatus} key={mainStatus.value}/>);
		});
		return (<span>
					<select
						onChange={this.handleChange.bind(this)}
						ref="loanStatusSelect">
						{options}
					</select>
		</span>);
	}
}

export default AddLoanSelect;